<!DOCTYPE html><html lang="en" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"><title>Lorem MoonのStory - あなたはしばらくここにいるだけですが、私の人生を変えました</title><meta name="keywords" content="Hexo, blog, Lorem Moon, github page"><meta name="author" content="Lorem Moon"><meta name="copyright" content="Lorem Moon"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="description" content="即已成过往，便随它而去吧。">
<meta property="og:type" content="website">
<meta property="og:title" content="Lorem MoonのStory">
<meta property="og:url" content="https://hello-github-ui.github.io/index.html">
<meta property="og:site_name" content="Lorem MoonのStory">
<meta property="og:description" content="即已成过往，便随它而去吧。">
<meta property="og:locale" content="en_US">
<meta property="og:image" content="https://pic.imgdb.cn/item/6159d89b2ab3f51d91b0e8d0.jpg">
<meta property="article:author" content="Lorem Moon">
<meta property="article:tag" content="Hexo, blog, Lorem Moon, github page">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://pic.imgdb.cn/item/6159d89b2ab3f51d91b0e8d0.jpg"><link rel="shortcut icon" href="/img/favicon.png"><link rel="canonical" href="https://hello-github-ui.github.io/"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><link rel="stylesheet" href="/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.css" media="print" onload="this.media='all'"><script>const GLOBAL_CONFIG = { 
  root: '/',
  algolia: {"appId":"D5QZVMNT9K","apiKey":"92de0b03da46fa778c95817524081160","indexName":"hexo-blog","hits":{"per_page":100},"languages":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}.","hits_stats":"${hits} results found in ${time} ms"}},
  localSearch: undefined,
  translate: undefined,
  noticeOutdate: {"limitDay":365,"position":"top","messagePrev":"It has been","messageNext":"days since the last update, the content of the article may be outdated."},
  highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":200},
  copy: {
    success: 'Copy successfully',
    error: 'Copy error',
    noSupport: 'The browser does not support'
  },
  relativeDate: {
    homepage: false,
    post: false
  },
  runtime: 'days',
  date_suffix: {
    just: 'Just',
    min: 'minutes ago',
    hour: 'hours ago',
    day: 'days ago',
    month: 'months ago'
  },
  copyright: undefined,
  lightbox: 'fancybox',
  Snackbar: undefined,
  source: {
    justifiedGallery: {
      js: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery@2/dist/fjGallery.min.js',
      css: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery@2/dist/fjGallery.min.css'
    }
  },
  isPhotoFigcaption: false,
  islazyload: false,
  isAnchor: false
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
  title: 'Lorem MoonのStory',
  isPost: false,
  isHome: true,
  isHighlightShrink: true,
  isToc: false,
  postUpdate: '2022-03-08 20:35:15'
}</script><noscript><style type="text/css">
  #nav {
    opacity: 1
  }
  .justified-gallery img {
    opacity: 1
  }

  #recent-posts time,
  #post-meta time {
    display: inline !important
  }
</style></noscript><script>(win=>{
    win.saveToLocal = {
      set: function setWithExpiry(key, value, ttl) {
        if (ttl === 0) return
        const now = new Date()
        const expiryDay = ttl * 86400000
        const item = {
          value: value,
          expiry: now.getTime() + expiryDay,
        }
        localStorage.setItem(key, JSON.stringify(item))
      },

      get: function getWithExpiry(key) {
        const itemStr = localStorage.getItem(key)

        if (!itemStr) {
          return undefined
        }
        const item = JSON.parse(itemStr)
        const now = new Date()

        if (now.getTime() > item.expiry) {
          localStorage.removeItem(key)
          return undefined
        }
        return item.value
      }
    }
  
    win.getScript = url => new Promise((resolve, reject) => {
      const script = document.createElement('script')
      script.src = url
      script.async = true
      script.onerror = reject
      script.onload = script.onreadystatechange = function() {
        const loadState = this.readyState
        if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
        script.onload = script.onreadystatechange = null
        resolve()
      }
      document.head.appendChild(script)
    })
  
      win.activateDarkMode = function () {
        document.documentElement.setAttribute('data-theme', 'dark')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
        }
      }
      win.activateLightMode = function () {
        document.documentElement.setAttribute('data-theme', 'light')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
        }
      }
      const t = saveToLocal.get('theme')
    
          if (t === 'dark') activateDarkMode()
          else if (t === 'light') activateLightMode()
        
      const asideStatus = saveToLocal.get('aside-status')
      if (asideStatus !== undefined) {
        if (asideStatus === 'hide') {
          document.documentElement.classList.add('hide-aside')
        } else {
          document.documentElement.classList.remove('hide-aside')
        }
      }
    
    const detectApple = () => {
      if(/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){
        document.documentElement.classList.add('apple')
      }
    }
    detectApple()
    })(window)</script><meta name="generator" content="Hexo 5.4.0"></head><body><div id="web_bg"></div><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img is-center"><img src="https://pic.imgdb.cn/item/6159d89b2ab3f51d91b0e8d0.jpg" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="site-data is-center"><div class="data-item"><a href="/archives/"><div class="headline">Articles</div><div class="length-num">60</div></a></div><div class="data-item"><a href="/tags/"><div class="headline">Tags</div><div class="length-num">46</div></a></div><div class="data-item"><a href="/categories/"><div class="headline">Categories</div><div class="length-num">5</div></a></div></div><hr/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> Home</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> Archives</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> Tags</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> Categories</span></a></div><div class="menus_item"><a class="site-page group" href="javascript:void(0);"><i class="fa-fw fas fa-list"></i><span> List</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/musics/"><i class="fa-fw fas fa-music"></i><span> Music</span></a></li><li><a class="site-page child" href="/movies/"><i class="fa-fw fas fa-video"></i><span> Movie</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> Link</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> About</span></a></div></div></div></div><div class="page" id="body-wrap"><header class="full_page" id="page-header" style="background-image: url('https://pic.imgdb.cn/item/604b7e335aedab222ce6194d.jpg')"><nav id="nav"><span id="blog_name"><a id="site-name" href="/">Lorem MoonのStory</a></span><div id="menus"><div id="search-button"><a class="site-page social-icon search"><i class="fas fa-search fa-fw"></i><span> Search</span></a></div><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> Home</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> Archives</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> Tags</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> Categories</span></a></div><div class="menus_item"><a class="site-page group" href="javascript:void(0);"><i class="fa-fw fas fa-list"></i><span> List</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/musics/"><i class="fa-fw fas fa-music"></i><span> Music</span></a></li><li><a class="site-page child" href="/movies/"><i class="fa-fw fas fa-video"></i><span> Movie</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> Link</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> About</span></a></div></div><div id="toggle-menu"><a class="site-page"><i class="fas fa-bars fa-fw"></i></a></div></div></nav><div id="site-info"><h1 id="site-title">Lorem MoonのStory</h1><div id="site_social_icons"><a class="social-icon" href="https://github.com/hello-github-ui" target="_blank" title="Github"><i class="fab fa-github"></i></a><a class="social-icon" href="mailto:util.you.come@gmail.com" target="_blank" title="Email"><i class="fas fa-envelope"></i></a></div></div><div id="scroll-down"><i class="fas fa-angle-down scroll-down-effects"></i></div></header><main class="layout" id="content-inner"><div class="recent-posts" id="recent-posts"><div class="recent-post-item"><div class="post_cover left"><a href="/posts/19545/" title="二零一九年快要过去了"><img class="post_bg" src="https://pic.imgdb.cn/item/6121110b4907e2d39c465a49.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="二零一九年快要过去了"></a></div><div class="recent-post-info"><a class="article-title" href="/posts/19545/" title="二零一九年快要过去了">二零一九年快要过去了</a><div class="article-meta-wrap"><span class="article-meta"><i class="fas fa-thumbtack sticky"></i><span class="sticky">Sticky</span><span class="article-meta__separator">|</span></span><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">Created</span><time class="post-meta-date-created" datetime="2019-12-28T01:39:03.000Z" title="Created 2019-12-28 09:39:03">2019-12-28</time><span class="article-meta__separator">|</span><i class="fas fa-history"></i><span class="article-meta-label">Updated</span><time class="post-meta-date-updated" datetime="2022-03-08T12:34:42.574Z" title="Updated 2022-03-08 20:34:42">2022-03-08</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E9%9A%8F%E7%AC%94/">随笔</a></span><span class="article-meta tags"><span class="article-meta-separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/tags/%E7%94%9F%E6%B4%BB/">生活</a></span></div><div class="content">
2019年不知不觉就要过去了，回首看这一年，发现真的是百事不顺啊，但好在挺过来了。

2019
哪個英文字母最酷？ 查看答案
  因為西裝褲(C裝酷)門裏站着一個人? Click
  閃2019年也算是我的一个小转折吧，主要有几件事：

因为工作换了城市
换工作
焦虑

因为工作换了城市 之前毕业后一直呆在安徽，说实话我也没觉得安徽有什么不好的，但是无奈总有一颗想流浪的心，所以在年初毅然决然离开熟悉的环境，只身一人南下
换工作 换了城市后不可避免的需要另换工作了，真是被坑了好大一波，难受😫
焦虑 这一年来感觉焦虑愈来愈烈，各种焦虑，真是诸事不顺呢
不管怎样，2019年快要过去了，祝福我们每一个人。

琵琶仙·中秋
    -- 清代：纳兰性德



碧海年年，试问取、冰轮为谁圆缺？吹到一片秋香，清辉了如雪。愁中看、好天良夜，知道尽成悲咽。只影而今，那堪重对，旧时明月。花径里、戏捉迷藏，曾惹下萧萧井梧叶。记否轻纨小扇，又几番凉热。只落得，填膺百感，总茫茫、不关离别。一任紫玉无情，夜寒吹裂。

</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/posts/4723/" title="Redis主从搭建"><img class="post_bg" src="https://pic.imgdb.cn/item/61210fda4907e2d39c439d0c.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Redis主从搭建"></a></div><div class="recent-post-info"><a class="article-title" href="/posts/4723/" title="Redis主从搭建">Redis主从搭建</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">Created</span><time class="post-meta-date-created" datetime="2022-03-08T12:34:42.574Z" title="Created 2022-03-08 20:34:42">2022-03-08</time><span class="article-meta__separator">|</span><i class="fas fa-history"></i><span class="article-meta-label">Updated</span><time class="post-meta-date-updated" datetime="2022-03-08T12:34:42.574Z" title="Updated 2022-03-08 20:34:42">2022-03-08</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E8%AE%B0%E4%BA%8B%E6%9C%AC/">记事本</a></span><span class="article-meta tags"><span class="article-meta-separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/tags/Centos/">Centos</a><span class="article-meta-link">•</span><a class="article-meta__tags" href="/tags/Redis/">Redis</a></span></div><div class="content">Redis主从复制redis的主从复制概念和mysql的主从复制大概类似。一台主机master，一台从机slaver。master主机数据更新后根据配置和策略，自动同步到slaver从机，Master以写为主，Slaver以读为主。

主要用途
读写分离：适用于读多写少的应用，增加多个从机，提高读的速度，提高程序的并发性
数据容灾恢复：从机复制主机的数据，相当于数据备份，如果主机数据丢失，那么可以通过从机存储的数据进行恢复
高并发、高可用集群实现的基础：在高并发的场景下，就算主机挂了，从机可以实现主从切换，从机自动成为主机对外提供服务

一主多从配置
环境准备我们用一台机器模拟三个机器，
将下载下来的redis复制三份
cp -R redis-5.0.3 redis01cp -R redis-5.0.3 redis02cp -R redis-5.0.3 redis03

如下图所示：


然后，在一台机器上启动三个redis，一个作 master，两个作 slaver，
master 端口：6380
slaver1 端口：6381
slaver2 端口：6382


</div></div></div><div class="recent-post-item"><div class="post_cover left"><a href="/posts/43818/" title="Win10开启上帝模式"><img class="post_bg" src="https://pic.imgdb.cn/item/621ddc1c2ab3f51d914c66cb.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Win10开启上帝模式"></a></div><div class="recent-post-info"><a class="article-title" href="/posts/43818/" title="Win10开启上帝模式">Win10开启上帝模式</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">Created</span><time class="post-meta-date-created" datetime="2022-03-08T12:24:42.000Z" title="Created 2022-03-08 20:24:42">2022-03-08</time><span class="article-meta__separator">|</span><i class="fas fa-history"></i><span class="article-meta-label">Updated</span><time class="post-meta-date-updated" datetime="2022-03-08T12:24:42.000Z" title="Updated 2022-03-08 20:24:42">2022-03-08</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E8%AE%B0%E4%BA%8B%E6%9C%AC/">记事本</a></span><span class="article-meta tags"><span class="article-meta-separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/tags/Windows/">Windows</a></span></div><div class="content">
windows 里面有各种各样的设置，有时候我们想要找到一个设置，非常麻烦，记不住位置，比如卸载软件等。别急，其实啊，我们只需要简单的一些设置，就可以开启一种称之为”上帝模式”的功能列表，接下来我们就来看看吧

1。首先在桌面新建一个文件夹2。然后将其重命名为：上帝模式.&#123;ED7BA470-8E54-465E-825C-99712043E01C&#125;3。这时它的桌面图标就变味了一个控制面板的样式了，此时你就可以通过双击打开它，会看到各种各样的功能
前面的字（上帝模式）可以随意命名
</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/posts/55966/" title="Ubuntu修改静态IP"><img class="post_bg" src="https://pic.imgdb.cn/item/621ddc1c2ab3f51d914c66cb.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Ubuntu修改静态IP"></a></div><div class="recent-post-info"><a class="article-title" href="/posts/55966/" title="Ubuntu修改静态IP">Ubuntu修改静态IP</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">Created</span><time class="post-meta-date-created" datetime="2022-03-04T16:11:25.000Z" title="Created 2022-03-05 00:11:25">2022-03-05</time><span class="article-meta__separator">|</span><i class="fas fa-history"></i><span class="article-meta-label">Updated</span><time class="post-meta-date-updated" datetime="2022-03-04T16:11:25.000Z" title="Updated 2022-03-05 00:11:25">2022-03-05</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E8%AE%B0%E4%BA%8B%E6%9C%AC/">记事本</a></span><span class="article-meta tags"><span class="article-meta-separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/tags/Linux/">Linux</a><span class="article-meta-link">•</span><a class="article-meta__tags" href="/tags/Ubuntu/">Ubuntu</a></span></div><div class="content">
Ubuntu 修改静态IP的方式与我们常用的‘红帽系linux’（比如centos）有很大区别，因此记录一下。

注意：适用于ubuntu18.04及以后版本先切换到 root 账号，然后执行下列操作。
先查看自己的网卡名称
输入：ifconfig，我此处的网卡名称是 ens33（注意，你的可能不一样，记住你的en开头的名称，下面修改会用到）

修改ubuntu18.04的网络配置文件
vim /etc/netplan/01-network-manager-all.yaml

# Let NetworkManager manage all devices on this systemnetwork: version: 2 renderer: NetworkManager ethernets:  ens33: #配置的网卡名称,使用ifconfig -a查看得到   dhcp4: no #dhcp4关闭   addresses: [10.144.144.10/24] #设置本机IP及掩码   gateway4:  10.144.144.2 #设置网关   nameservers:    ...</div></div></div><div class="recent-post-item"><div class="post_cover left"><a href="/posts/42154/" title="Java封装同步锁"><img class="post_bg" src="https://pic.imgdb.cn/item/621ddc1c2ab3f51d914c66cb.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Java封装同步锁"></a></div><div class="recent-post-info"><a class="article-title" href="/posts/42154/" title="Java封装同步锁">Java封装同步锁</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">Created</span><time class="post-meta-date-created" datetime="2022-03-02T12:50:01.000Z" title="Created 2022-03-02 20:50:01">2022-03-02</time><span class="article-meta__separator">|</span><i class="fas fa-history"></i><span class="article-meta-label">Updated</span><time class="post-meta-date-updated" datetime="2022-03-02T12:50:01.000Z" title="Updated 2022-03-02 20:50:01">2022-03-02</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E8%AE%B0%E4%BA%8B%E6%9C%AC/">记事本</a></span><span class="article-meta tags"><span class="article-meta-separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/tags/Java/">Java</a></span></div><div class="content">
先来看一段简单的同步锁代码

@Controllerpublic class DemoController &#123;    private final Logger logger = LoggerFactory.getLogger(DemoController.class);    @RequestMapping(&quot;/process/&#123;orderId&#125;&quot;)    @ResponseBody    public Map&lt;String, Object&gt; process(@PathVariable(&quot;orderId&quot;) String orderId) throws Exception &#123;        synchronized (this) &#123;            logger.debug(&quot;[&#123;&#125;] 开始&quot;, orderId);            Thread.sleep(1500);            logger.debug(&quot;[ ...</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/posts/1553/" title="初识大数据(一)"><img class="post_bg" src="https://cdn.jsdelivr.net/gh/jerryc127/CDN@latest/cover/default_bg3.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="初识大数据(一)"></a></div><div class="recent-post-info"><a class="article-title" href="/posts/1553/" title="初识大数据(一)">初识大数据(一)</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">Created</span><time class="post-meta-date-created" datetime="2022-03-01T07:53:43.000Z" title="Created 2022-03-01 15:53:43">2022-03-01</time><span class="article-meta__separator">|</span><i class="fas fa-history"></i><span class="article-meta-label">Updated</span><time class="post-meta-date-updated" datetime="2022-03-01T08:24:12.000Z" title="Updated 2022-03-01 16:24:12">2022-03-01</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E8%AE%B0%E4%BA%8B%E6%9C%AC/">记事本</a></span><span class="article-meta tags"><span class="article-meta-separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/tags/Hadoop/">Hadoop</a><span class="article-meta-link">•</span><a class="article-meta__tags" href="/tags/BigData/">BigData</a><span class="article-meta-link">•</span><a class="article-meta__tags" href="/tags/Spark/">Spark</a><span class="article-meta-link">•</span><a class="article-meta__tags" href="/tags/Hive/">Hive</a></span></div><div class="content">大数据基础
Hadoop 三大发行版本：Apache、Cloudera、Hortonworks。这里以普通的 Apache Hadoop 方式搭建大数据环境（后面会考虑使用更贴合实际的 CDH 版本的 Hadoop集群）

Hadoop Yarn集群的搭建虚拟机的准备
先准备三台centos7虚拟机，具体方式不做演示

修改 IP
第一台虚拟机修改为如下内容：

#  vim /etc/sysconfig/network-scripts/ifcfgens33TYPE=EthernetPROXY_METHOD=noneBROWSER_ONLY=noBOOTPROTO=staticDEFROUTE=yesIPV4_FAILURE_FATAL=noIPV6INIT=yesIPV6_AUTOCONF=yesIPV6_DEFROUTE=yesIPV6_FAILURE_FATAL=noIPV6_ADDR_GEN_MODE=stable-privacyNAME=ens33UUID=29b35945-26d7-4f4f-9924-ff97b9bf0638DEVICE=ens33ONBOOT=yesIP ...</div></div></div><div class="recent-post-item"><div class="post_cover left"><a href="/posts/49781/" title="Tomcat加载本地静态页面"><img class="post_bg" src="https://cdn.jsdelivr.net/gh/jerryc127/CDN@latest/cover/default_bg2.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Tomcat加载本地静态页面"></a></div><div class="recent-post-info"><a class="article-title" href="/posts/49781/" title="Tomcat加载本地静态页面">Tomcat加载本地静态页面</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">Created</span><time class="post-meta-date-created" datetime="2022-02-23T12:38:48.000Z" title="Created 2022-02-23 20:38:48">2022-02-23</time><span class="article-meta__separator">|</span><i class="fas fa-history"></i><span class="article-meta-label">Updated</span><time class="post-meta-date-updated" datetime="2022-03-08T12:34:42.574Z" title="Updated 2022-03-08 20:34:42">2022-03-08</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E8%AE%B0%E4%BA%8B%E6%9C%AC/">记事本</a></span><span class="article-meta tags"><span class="article-meta-separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/tags/Tomcat/">Tomcat</a></span></div><div class="content">加载静态页面
我们经常有这样一些需求：本地电脑有静态页面需要访问，但是呢又不想使用本地File:///这种文件协议访问，想通过本地启动一个服务器实现动态访问这些页面。这时候呢，我们通常会使用一些本身提供服务器的编辑器来使用，比如vsCode，HbuilderX等；但是呢有时候又不想单独下载这些东西，刚好本地又有Apache这类服务器，于是就可以通过本地tomcat来实现这个需求。

前提Apache Tomcat windows 版本先下载解压到本地
修改配置文件修改 $TOMCAT_HOME\conf\server.xml 文件：在文件的自带 &lt;host&gt;&lt;/host&gt; 下面新增如下代码，
&lt;Host name=&quot;127.0.0.1&quot; debug=&quot;0&quot; appBase=&quot;webapps&quot; unpackWARs=&quot;true&quot; autoDeploy=&quot;true&quot; xmlValidation=&quot;false&quot;  xmlNamespaceAwa ...</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/posts/16754/" title="Git进阶宝典"><img class="post_bg" src="https://img.imgdb.cn/item/604b9fb75aedab222cf8a2c0.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Git进阶宝典"></a></div><div class="recent-post-info"><a class="article-title" href="/posts/16754/" title="Git进阶宝典">Git进阶宝典</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">Created</span><time class="post-meta-date-created" datetime="2022-01-27T15:07:43.000Z" title="Created 2022-01-27 23:07:43">2022-01-27</time><span class="article-meta__separator">|</span><i class="fas fa-history"></i><span class="article-meta-label">Updated</span><time class="post-meta-date-updated" datetime="2022-03-08T12:34:42.570Z" title="Updated 2022-03-08 20:34:42">2022-03-08</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E8%AE%B0%E4%BA%8B%E6%9C%AC/">记事本</a></span><span class="article-meta tags"><span class="article-meta-separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/tags/Git/">Git</a></span></div><div class="content">虽然每天多多少少都会敲一些 Git 命令，但仍然有很多记不住，可怜我这脑袋瓜子了。。
一般来说，日常使用只要记住下图中这 6 个命令就可以了，但是熟练使用 Git，恐怕要记住60～100个命令~
在 Git 专题的开篇，我就提醒大家一定要记住这几个专用名词，对掌握 Git 有很大的帮助：
Workspace：工作区Index / Stage：暂存区Repository：仓库区（或本地仓库）Remote：远程仓库当然了，没记住的话，也不要紧了，今天就趁机再温故一遍。
下面是阮一峰老师整理的常用 Git 命令清单，有必要的话，可以打印一份出来，放在工作台~
http://www.ruanyifeng.com/blog/2015/12/git-cheat-sheet.html
一、新建代码库
在当前目录新建一个Git代码库$ git init
新建一个目录，将其初始化为Git代码库$ git init [project-name]
下载一个项目和它的整个代码历史$ git clone [url]二、配置Git的配置文件为.gitconfig，它可以在用户主目录下（全局配置），也可以在项目目录 ...</div></div></div><div class="recent-post-item"><div class="post_cover left"><a href="/posts/22086/" title="Centos7安装Redis"><img class="post_bg" src="https://cdn.jsdelivr.net/gh/jerryc127/CDN@latest/cover/default_bg3.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Centos7安装Redis"></a></div><div class="recent-post-info"><a class="article-title" href="/posts/22086/" title="Centos7安装Redis">Centos7安装Redis</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">Created</span><time class="post-meta-date-created" datetime="2022-01-10T16:25:48.000Z" title="Created 2022-01-11 00:25:48">2022-01-11</time><span class="article-meta__separator">|</span><i class="fas fa-history"></i><span class="article-meta-label">Updated</span><time class="post-meta-date-updated" datetime="2022-03-08T12:34:42.570Z" title="Updated 2022-03-08 20:34:42">2022-03-08</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E8%AE%B0%E4%BA%8B%E6%9C%AC/">记事本</a></span><span class="article-meta tags"><span class="article-meta-separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/tags/Centos/">Centos</a><span class="article-meta-link">•</span><a class="article-meta__tags" href="/tags/Redis/">Redis</a></span></div><div class="content">1. 下载从官网下载redis压缩包到本地
2. 解压tar -zxvf redis-6.0.6.tar.gz
3. 升级 gcc
自 redis 6.0.0 之后，编译 redis 需要支持 C11 特性，C11 特性在 4.9 中被引入。  Centos7 默认 gcc 版本为 4.8.5，所以需要升级gcc版本。

解决方式：
scriptyum -y install gcc gcc-c++ make tclyum -y install centos-release-sclyum -y install devtoolset-9-gcc devtoolset-9-gcc-c++ devtoolset-9-binutilsscl enable devtoolset-9 bash
4. 编译通过make来编译，make是自动编译，会根据Makefile中描述的内容来进行编译。
scriptcd redis-6.0.6make
可以看到在src目录下生成了几个新的文件。
5. 安装scriptmake install
实际上，就是将这个几个文件加到/usr/local/bin目录下去。这 ...</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/posts/5426/" title="Linux Mint20 使用体验"><img class="post_bg" src="https://pic.imgdb.cn/item/61ab5b682ab3f51d9166eeb3.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Linux Mint20 使用体验"></a></div><div class="recent-post-info"><a class="article-title" href="/posts/5426/" title="Linux Mint20 使用体验">Linux Mint20 使用体验</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">Created</span><time class="post-meta-date-created" datetime="2021-12-04T11:10:18.000Z" title="Created 2021-12-04 19:10:18">2021-12-04</time><span class="article-meta__separator">|</span><i class="fas fa-history"></i><span class="article-meta-label">Updated</span><time class="post-meta-date-updated" datetime="2022-03-08T12:34:42.570Z" title="Updated 2022-03-08 20:34:42">2022-03-08</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E7%AC%94%E8%AE%B0/">笔记</a></span><span class="article-meta tags"><span class="article-meta-separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/tags/Linux/">Linux</a><span class="article-meta-link">•</span><a class="article-meta__tags" href="/tags/Mint/">Mint</a></span></div><div class="content">
上周我把我的华硕笔记本重装成Linux Mint20系统了，以后我就不打算使用windows了，太流氓了。至于系统怎么装的，就不细说了，因为坑之前装过windows的电脑装想直接装Linux系统坑还是太多了，其因有以下几点：其一，windows系统下基本是多个分区，例如：通常有c，d，e盘等，而这就是一个巨坑，因为Linux可没有分区盘符的概念，它是从内核到上层软件都是一个FS系统，只有一个分区系统；其二，windows下常用的软件在目前水平下的linux中不好装，即使侥幸安装成功也会有各种各样的bug，就拿微信来说吧，实在是不好安装，需要各种插件依赖下载一大堆，成功安装之后，在输入汉字字符时，你是看不到你打的是什么字的，只有在发送之后才能看到（天啊，不敢相信）其三，翻墙代理软件实在是不好安装，相比windows，安卓，mac下的软件生态，linxu下实在是用户量颇少，生态更不好。其他的原因就更不说了，当你细细使用之后就能体验到了。所以说Linux不适合普通人使用下面来说一下常用软件怎么安装吧？

MySQL8 的安装我们在下载一个软件之前首先要做的一件事是什么呢？对喽，先看一下电脑 ...</div></div></div><nav id="pagination"><div class="pagination"><span class="page-number current">1</span><a class="page-number" href="/page/2/#content-inner">2</a><span class="space">&hellip;</span><a class="page-number" href="/page/6/#content-inner">6</a><a class="extend next" rel="next" href="/page/2/#content-inner"><i class="fas fa-chevron-right fa-fw"></i></a></div></nav></div><div class="aside-content" id="aside-content"><div class="card-widget card-info"><div class="is-center"><div class="avatar-img"><img src="https://pic.imgdb.cn/item/6159d89b2ab3f51d91b0e8d0.jpg" onerror="this.onerror=null;this.src='/img/friend_404.gif'" alt="avatar"/></div><div class="author-info__name">Lorem Moon</div><div class="author-info__description">即已成过往，便随它而去吧。</div></div><div class="card-info-data is-center"><div class="card-info-data-item"><a href="/archives/"><div class="headline">Articles</div><div class="length-num">60</div></a></div><div class="card-info-data-item"><a href="/tags/"><div class="headline">Tags</div><div class="length-num">46</div></a></div><div class="card-info-data-item"><a href="/categories/"><div class="headline">Categories</div><div class="length-num">5</div></a></div></div><a class="button--animated" id="card-info-btn" target="_blank" rel="noopener" href="https://github.com/xxxxxx"><i class="fab fa-github"></i><span>Follow Me</span></a><div class="card-info-social-icons is-center"><a class="social-icon" href="https://github.com/hello-github-ui" target="_blank" title="Github"><i class="fab fa-github"></i></a><a class="social-icon" href="mailto:util.you.come@gmail.com" target="_blank" title="Email"><i class="fas fa-envelope"></i></a></div></div><div class="card-widget card-announcement"><div class="item-headline"><i class="fas fa-bullhorn card-announcement-animation"></i><span>Announcement</span></div><div class="announcement_content">This is my Blog</div></div><div class="sticky_layout"><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>Recent Post</span></div><div class="aside-list"><div class="aside-list-item"><a class="thumbnail" href="/posts/4723/" title="Redis主从搭建"><img src="https://pic.imgdb.cn/item/61210fda4907e2d39c439d0c.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Redis主从搭建"/></a><div class="content"><a class="title" href="/posts/4723/" title="Redis主从搭建">Redis主从搭建</a><time datetime="2022-03-08T12:34:42.574Z" title="Created 2022-03-08 20:34:42">2022-03-08</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/posts/43818/" title="Win10开启上帝模式"><img src="https://pic.imgdb.cn/item/621ddc1c2ab3f51d914c66cb.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Win10开启上帝模式"/></a><div class="content"><a class="title" href="/posts/43818/" title="Win10开启上帝模式">Win10开启上帝模式</a><time datetime="2022-03-08T12:24:42.000Z" title="Created 2022-03-08 20:24:42">2022-03-08</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/posts/55966/" title="Ubuntu修改静态IP"><img src="https://pic.imgdb.cn/item/621ddc1c2ab3f51d914c66cb.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Ubuntu修改静态IP"/></a><div class="content"><a class="title" href="/posts/55966/" title="Ubuntu修改静态IP">Ubuntu修改静态IP</a><time datetime="2022-03-04T16:11:25.000Z" title="Created 2022-03-05 00:11:25">2022-03-05</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/posts/42154/" title="Java封装同步锁"><img src="https://pic.imgdb.cn/item/621ddc1c2ab3f51d914c66cb.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Java封装同步锁"/></a><div class="content"><a class="title" href="/posts/42154/" title="Java封装同步锁">Java封装同步锁</a><time datetime="2022-03-02T12:50:01.000Z" title="Created 2022-03-02 20:50:01">2022-03-02</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/posts/1553/" title="初识大数据(一)"><img src="https://cdn.jsdelivr.net/gh/jerryc127/CDN@latest/cover/default_bg3.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="初识大数据(一)"/></a><div class="content"><a class="title" href="/posts/1553/" title="初识大数据(一)">初识大数据(一)</a><time datetime="2022-03-01T07:53:43.000Z" title="Created 2022-03-01 15:53:43">2022-03-01</time></div></div></div></div><div class="card-widget" id="card-newest-comments"><div class="item-headline"><i class="fas fa-comment-dots"></i><span>Newest Comments</span></div><div class="aside-list"><span>loading...</span></div></div><div class="card-widget card-categories"><div class="item-headline">
            <i class="fas fa-folder-open"></i>
            <span>Categories</span>
            
            </div>
            <ul class="card-category-list" id="aside-cat-list">
            <li class="card-category-list-item "><a class="card-category-list-link" href="/categories/code/"><span class="card-category-list-name">code</span><span class="card-category-list-count">35</span></a><ul class="card-category-list child"><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/code/%E8%AE%B0%E4%BA%8B%E6%9C%AC/"><span class="card-category-list-name">记事本</span><span class="card-category-list-count">2</span></a></li></ul></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/%E7%AC%94%E8%AE%B0/"><span class="card-category-list-name">笔记</span><span class="card-category-list-count">1</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/%E8%AE%B0%E4%BA%8B%E6%9C%AC/"><span class="card-category-list-name">记事本</span><span class="card-category-list-count">21</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/%E9%9A%8F%E7%AC%94/"><span class="card-category-list-name">随笔</span><span class="card-category-list-count">3</span></a></li>
            </ul></div><div class="card-widget card-tags"><div class="item-headline"><i class="fas fa-tags"></i><span>Tags</span></div><div class="card-tag-cloud"><a href="/tags/Java/" style="font-size: 1.45em; color: rgb(103, 132, 74)">Java</a><a href="/tags/CSS/" style="font-size: 1.15em; color: rgb(113, 157, 110)">CSS</a><a href="/tags/HTML/" style="font-size: 1.15em; color: rgb(156, 7, 166)">HTML</a><a href="/tags/MySQL/" style="font-size: 1.33em; color: rgb(18, 102, 115)">MySQL</a><a href="/tags/Centos7/" style="font-size: 1.15em; color: rgb(187, 111, 119)">Centos7</a><a href="/tags/Centos/" style="font-size: 1.21em; color: rgb(64, 200, 39)">Centos</a><a href="/tags/Redis/" style="font-size: 1.39em; color: rgb(27, 51, 36)">Redis</a><a href="/tags/%E5%9F%BA%E7%A1%80/" style="font-size: 1.33em; color: rgb(183, 93, 67)">基础</a><a href="/tags/%E7%AC%94%E8%AE%B0/" style="font-size: 1.15em; color: rgb(125, 78, 68)">笔记</a><a href="/tags/ElasticSearch/" style="font-size: 1.15em; color: rgb(50, 121, 127)">ElasticSearch</a><a href="/tags/%E6%95%B0%E6%8D%AE/" style="font-size: 1.15em; color: rgb(120, 11, 124)">数据</a><a href="/tags/Flink/" style="font-size: 1.15em; color: rgb(6, 199, 193)">Flink</a><a href="/tags/%E5%A4%A7%E6%95%B0%E6%8D%AE/" style="font-size: 1.15em; color: rgb(134, 169, 154)">大数据</a><a href="/tags/Git/" style="font-size: 1.21em; color: rgb(102, 140, 50)">Git</a><a href="/tags/GitHub/" style="font-size: 1.15em; color: rgb(70, 53, 165)">GitHub</a><a href="/tags/%E8%A7%86%E9%A2%91/" style="font-size: 1.15em; color: rgb(19, 140, 107)">视频</a><a href="/tags/%E5%B7%A5%E5%85%B7/" style="font-size: 1.27em; color: rgb(62, 19, 79)">工具</a><a href="/tags/Excel/" style="font-size: 1.15em; color: rgb(10, 96, 84)">Excel</a><a href="/tags/Linux/" style="font-size: 1.33em; color: rgb(45, 17, 200)">Linux</a><a href="/tags/Mint/" style="font-size: 1.15em; color: rgb(83, 41, 97)">Mint</a><a href="/tags/Socket/" style="font-size: 1.21em; color: rgb(193, 93, 181)">Socket</a><a href="/tags/%E7%BD%91%E7%BB%9C%E7%BC%96%E7%A8%8B/" style="font-size: 1.21em; color: rgb(119, 163, 65)">网络编程</a><a href="/tags/Spring-AOP/" style="font-size: 1.21em; color: rgb(8, 137, 29)">Spring AOP</a><a href="/tags/AOP/" style="font-size: 1.27em; color: rgb(22, 47, 23)">AOP</a><a href="/tags/SpringBoot/" style="font-size: 1.33em; color: rgb(113, 125, 83)">SpringBoot</a><a href="/tags/Logback/" style="font-size: 1.15em; color: rgb(163, 113, 57)">Logback</a><a href="/tags/Tomcat/" style="font-size: 1.21em; color: rgb(141, 50, 119)">Tomcat</a><a href="/tags/Ubuntu/" style="font-size: 1.21em; color: rgb(144, 165, 15)">Ubuntu</a><a href="/tags/VMWare/" style="font-size: 1.15em; color: rgb(160, 158, 187)">VMWare</a><a href="/tags/Vim/" style="font-size: 1.15em; color: rgb(21, 81, 81)">Vim</a><a href="/tags/Windows/" style="font-size: 1.15em; color: rgb(170, 54, 45)">Windows</a><a href="/tags/WSL/" style="font-size: 1.15em; color: rgb(3, 127, 152)">WSL</a><a href="/tags/Vue/" style="font-size: 1.21em; color: rgb(12, 17, 57)">Vue</a><a href="/tags/ElementUI/" style="font-size: 1.15em; color: rgb(128, 64, 185)">ElementUI</a><a href="/tags/%E7%94%9F%E6%B4%BB/" style="font-size: 1.21em; color: rgb(195, 168, 103)">生活</a><a href="/tags/Python/" style="font-size: 1.15em; color: rgb(152, 145, 48)">Python</a><a href="/tags/%E5%BC%82%E5%B8%B8/" style="font-size: 1.15em; color: rgb(68, 147, 176)">异常</a><a href="/tags/ControllerAdvice/" style="font-size: 1.15em; color: rgb(110, 160, 7)">@ControllerAdvice</a><a href="/tags/RocketMQ/" style="font-size: 1.33em; color: rgb(192, 124, 146)">RocketMQ</a><a href="/tags/Hadoop/" style="font-size: 1.15em; color: rgb(139, 139, 140)">Hadoop</a></div></div><div class="card-widget card-archives"><div class="item-headline"><i class="fas fa-archive"></i><span>Archives</span><a class="card-more-btn" href="/archives/" title="More">
    <i class="fas fa-angle-right"></i></a></div><ul class="card-archive-list"><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2022/03/"><span class="card-archive-list-date">March 2022</span><span class="card-archive-list-count">5</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2022/02/"><span class="card-archive-list-date">February 2022</span><span class="card-archive-list-count">1</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2022/01/"><span class="card-archive-list-date">January 2022</span><span class="card-archive-list-count">2</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2021/12/"><span class="card-archive-list-date">December 2021</span><span class="card-archive-list-count">1</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2021/11/"><span class="card-archive-list-date">November 2021</span><span class="card-archive-list-count">10</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2021/10/"><span class="card-archive-list-date">October 2021</span><span class="card-archive-list-count">8</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2021/09/"><span class="card-archive-list-date">September 2021</span><span class="card-archive-list-count">2</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2021/08/"><span class="card-archive-list-date">August 2021</span><span class="card-archive-list-count">2</span></a></li></ul></div><div class="card-widget card-webinfo"><div class="item-headline"><i class="fas fa-chart-line"></i><span>Info</span></div><div class="webinfo"><div class="webinfo-item"><div class="item-name">Article :</div><div class="item-count">60</div></div><div class="webinfo-item"><div class="item-name">Run time :</div><div class="item-count" id="runtimeshow" data-publishDate="2017-07-01T00:00:00.000Z"></div></div><div class="webinfo-item"><div class="item-name">Total Count :</div><div class="item-count">127.5k</div></div><div class="webinfo-item"><div class="item-name">UV :</div><div class="item-count" id="busuanzi_value_site_uv"></div></div><div class="webinfo-item"><div class="item-name">PV :</div><div class="item-count" id="busuanzi_value_site_pv"></div></div><div class="webinfo-item"><div class="item-name">Last Push :</div><div class="item-count" id="last-push-date" data-lastPushDate="2022-03-08T12:35:15.995Z"></div></div></div></div></div></div></main><footer id="footer" style="background-image: url('https://pic.imgdb.cn/item/604b7e335aedab222ce6194d.jpg')"><div id="footer-wrap"><div class="copyright">&copy;2017 - 2022 By Lorem Moon</div><div class="framework-info"><span>Framework </span><a target="_blank" rel="noopener" href="https://hexo.io">Hexo</a><span class="footer-separator">|</span><span>Theme </span><a target="_blank" rel="noopener" href="https://github.com/jerryc127/hexo-theme-butterfly">Butterfly</a></div><div class="footer_custom_text">Hi, welcome to my <a target="_blank" rel="noopener" href="https://hello-blogger-ui.blogspot.com/">google blog</a>!</div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="darkmode" type="button" title="Switch Between Light And Dark Mode"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="Toggle between single-column and double-column"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="Setting"><i class="fas fa-cog fa-spin"></i></button><button id="go-up" type="button" title="Back To Top"><i class="fas fa-arrow-up"></i></button></div></div><div id="algolia-search"><div class="search-dialog"><nav class="search-nav"><span class="search-dialog-title">Algolia</span><button class="search-close-button"><i class="fas fa-times"></i></button></nav><div class="search-wrap"><div id="algolia-search-input"></div><hr/><div id="algolia-search-results"><div id="algolia-hits"></div><div id="algolia-pagination"></div><div id="algolia-stats"></div></div></div></div><div id="search-mask"></div></div><div><script src="/js/utils.js"></script><script src="/js/main.js"></script><script src="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.umd.js"></script><script src="https://cdn.jsdelivr.net/npm/algoliasearch@4/dist/algoliasearch-lite.umd.js"></script><script src="https://cdn.jsdelivr.net/npm/instantsearch.js@4/dist/instantsearch.production.min.js"></script><script src="/js/search/algolia.js"></script><div class="js-pjax"></div><script src="https://cdn.jsdelivr.net/npm/blueimp-md5@2.17.0/js/md5.min.js"></script><script>window.addEventListener('load', () => {
  const changeContent = (content) => {
    if (content === '') return content

    content = content.replace(/<img.*?src="(.*?)"?[^\>]+>/ig, '[image]') // replace image link
    content = content.replace(/<a[^>]+?href=["']?([^"']+)["']?[^>]*>([^<]+)<\/a>/gi, '[link]') // replace url
    content = content.replace(/<pre><code>.*?<\/pre>/gi, '[code]') // replace code
    content = content.replace(/<[^>]+>/g,"") // remove html tag

    if (content.length > 150) {
      content = content.substring(0,150) + '...'
    }
    return content
  }

  const getIcon = (icon, mail) => {
    if (icon) return icon
    let defaultIcon = '?d=monsterid'
    let iconUrl = `https://gravatar.loli.net/avatar/${md5(mail.toLowerCase()) + defaultIcon}`
    return iconUrl
  }

  const generateHtml = array => {
    let result = ''

    if (array.length) {
      for (let i = 0; i < array.length; i++) {
        result += '<div class=\'aside-list-item\'>'

        if (true) {
          const name = 'src'
          result += `<a href='${array[i].url}' class='thumbnail'><img ${name}='${array[i].avatar}' alt='${array[i].nick}'></a>`
        }

        result += `<div class='content'>
        <a class='comment' href='${array[i].url}' title='${array[i].content}'>${array[i].content}</a>
        <div class='name'><span>${array[i].nick} / </span><time datetime="${array[i].date}">${btf.diffDate(array[i].date, true)}</time></div>
        </div></div>`
      }
    } else {
      result += 'No Comment'
    }

    let $dom = document.querySelector('#card-newest-comments .aside-list')
    $dom.innerHTML= result
    window.lazyLoadInstance && window.lazyLoadInstance.update()
    window.pjax && window.pjax.refresh($dom)
  }

  const getComment = () => {
    const serverURL = 'https://mFM6i90b.api.lncldglobal.com'

    var settings = {
      "method": "GET",
      "headers": {
        "X-LC-Id": 'mFM6i90bN6KqyTH6tmC3q7dz-gzGzoHsz',
        "X-LC-Key": 'T2tsKoiKjMaB0wgtIAgSz6Ul',
        "Content-Type": "application/json"
      },
    }

    fetch(`${serverURL}/1.1/classes/Comment?limit=6&order=-createdAt`,settings)
      .then(response => response.json())
      .then(data => {
        const valineArray = data.results.map(function (e) {
          return {
            'avatar': getIcon(e.QQAvatar, e.mail),
            'content': changeContent(e.comment),
            'nick': e.nick,
            'url': e.url + '#' + e.objectId,
            'date': e.updatedAt,
          }
        })
        saveToLocal.set('valine-newest-comments', JSON.stringify(valineArray), 10/(60*24))
        generateHtml(valineArray)
      }).catch(e => {
        const $dom = document.querySelector('#card-newest-comments .aside-list')
        $dom.innerHTML= "Unable to get the data, please make sure the settings are correct."
      }) 
  }

  const newestCommentInit = () => {
    if (document.querySelector('#card-newest-comments .aside-list')) {
      const data = saveToLocal.get('valine-newest-comments')
      if (data) {
        generateHtml(JSON.parse(data))
      } else {
        getComment()
      }
    }
  }

  newestCommentInit()
  document.addEventListener('pjax:complete', newestCommentInit)
})</script><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script></div></body></html>